Using Sorting Filter filters
Sorting Filter either orders objects by their position on the z axis or groups them by their material type.
For example, use sorting filters to optimize the performance of your Kanzi application:
- Preventing overdraw. Excessive overdraw can decrease performance on the GPU in the form of increased fill-rate. See Preventing overdraw with the Sorting Filter.
- Rendering transparent objects. Because visualization of transparent nodes relies on having proper data behind them, in order to solve the blending equations properly, to correctly render transparent nodes, you must render them from back to front. See Rendering transparent nodes.
- Reducing shader switches. If nodes are presented in an order that requires excessive switching between shader programs, the rendering can slow down. See Reducing shader switches.
Creating a Sorting Filter
To create a sorting filter:
- In the Library press Alt and right-click Composing > Pipeline and select Sorting Filter.
- In the Properties set:
- Source to the source from where you want to collect nodes for filtering.
For example, to apply your filter to all nodes in your project, select Root Object Source. You can select the output of another filter as the source from where you collect nodes for filtering. - Sorting Type to either:
- View z to arrange the objects by their position along the z axis.
- Material type to group the objects by their material type.
By grouping objects by their material type you can optimize your Kanzi application, because that way Kanzi can decrease the number of shader switches. See Reducing shader switches.
- Either enable or disable the Reverse Order property:
- When enabled it reverses the current order of objects.
- When disabled it keeps the current order of objects.
- To take the filter into use, in the Library > Composing create a Render Pass or a Composer and a Render Pass, that you want to use to render your scene.
![](../../Resources/Images/Working with/Composers/Creating a rendering effect.png)
- In the Library select the Render Pass and in the Properties set the Object Source property to the filter you created.
- In the Project select the Scene node to which you want to apply the filter and in the Properties set the Composer property to the composer or render pass that uses as its object source the filter you created.
Kanzi Studio renders the nodes collected by the filter.
See also
Preventing overdraw with the Sorting Filter
Rendering transparent nodes
Reducing shader switches
Using Contains Property Filter filters
Using Property Is Equal Filter filters
Using Object Type Filter filters
Using Tag Filter filters
Filters
Open topic with navigation